class Player(object):
    numbers = 0
    levels = ['青铜', '白银', '黄金', '铂金', '钻石', '王者']

    def __init__(self, name, age, city, level):
        self.name = name
        self.age = age
        self.city = city
        if level not in Player.levels:
            raise Exception("段位设置错误！")
        else:
            self.level = level
        Player.numbers += 1

    def level_up(self):
        current = self.levels.index(self.level)
        if current < len(self.levels) - 1:
            self.level = self.levels[current + 1]

    def show(self):  # 实例的方法
        print(f'我是荣耀王者的第{Player.numbers}个玩家，我的名字是{self.name}，我来自{self.city}，我的段位是{self.level}')

    def get_weapon(self, weapon):
        self.weapon = weapon

    @classmethod
    def get_Player(cls):
        print(f"一共有{Player.numbers}个玩家注册了王者荣耀")

    def show_weapon(self):
        return self.weapon.show_weapon()


class Weapon(object):
    numbers = 0
    max_damage = 10000
    levels = ['青铜', '白银', '黄金', '铂金', '钻石', '王者']
    all_weapon = []

    def __init__(self, name, level, damage):
        self.name = name
        self.level = level
        self.damage = damage
        if damage > Weapon.max_damage:
            raise Exception("最大伤害值是10000，请重试！")
        if level not in Weapon.levels:
            raise Exception("段位设置错误！")
        Weapon.all_weapon.append(self.damage)

    def show_weapon(self):
        for k, v in self.__dict__.items():
            print(k, v)

    @classmethod
    def get_max_damage(cls):
        max_damage = 0
        for i in Weapon.all_weapon:
            if i > max_damage:
                max_damage = i
        return max_damage


mia = Player('mia', '19', '上海', '青铜')
tom = Player('tom', '20', '广州', '白银')
mia.get_Player()
gun = Weapon('gun', '青铜', 5000)
arrow = Weapon('arrow', '白银', 6000)
print(Weapon.get_max_damage())